package com.example.administrator.capital.mine.second;


import android.os.Bundle;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.administrator.capital.R;
import com.example.administrator.capital.base.BaseBackFragment;
import com.example.administrator.capital.eventbus.TabSelectedEvent;
import com.example.administrator.capital.mine.RechargeFragment;

import eventbusactivityscope.EventBusActivityScope;

/**
 * A simple {@link Fragment} subclass.
 * 消息详情
 */
public class NewDetailFragment extends BaseBackFragment {

    private TextView mBack, mRemove;
    public NewDetailFragment() {
        // Required empty public constructor
    }

    public static NewDetailFragment newInstance(int id) {

        Bundle args = new Bundle();
        args.putInt("id",id);
        NewDetailFragment fragment = new NewDetailFragment();
        fragment.setArguments(args);
        return fragment;
    }
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_new_detail, container, false);
    }

    @Override
    protected void initView(View view) {
        super.initView(view);
        mRemove = view.findViewById(R.id.app_title_action);
        mBack = view.findViewById(R.id.app_title_back);
    }

    @Override
    protected void setListener() {
        super.setListener();
        mRemove.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                EventBusActivityScope.getDefault(getActivity()).post(new TabSelectedEvent(mBundle.getInt("id")));
                _mActivity.onBackPressed();
            }
        });
        mBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                _mActivity.onBackPressed();

            }
        });
    }
}
